<div class="leagues view">
<h2><?php  __('League');?>: <?php echo $league['League']['strName']; ?></h2>
	<dl><?php $i = 0; $class = ' class="altrow"';?>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Manager'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $html->link($league['Coach']['strName'], array('controller' => 'coaches', 'action' => 'view', $league['Coach']['id'])); ?>
			&nbsp;
		</dd>
	</dl>
</div>
<div class="actions">
	<ul>
		<li><?php echo $html->link(__('Edit League', true), array('action' => 'edit', $league['League']['id'])); ?> </li>
		<li><?php echo $html->link(__('Delete League', true), array('action' => 'delete', $league['League']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $league['League']['id'])); ?> </li>
		<li><?php echo $html->link(__('List Leagues', true), array('action' => 'index')); ?> </li>
		<li><?php echo $html->link(__('List Championships', true), array('controller' => 'championships', 'action' => 'index')); ?> </li>
		<li><?php echo $html->link(__('List Teams', true), array('controller' => 'teams', 'action' => 'index')); ?> </li>
	</ul>
</div>
<div class="related">
	<h3><?php __('Championships');?></h3>
	<?php if (!empty($league['Championship'])):?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php __('Name'); ?></th>
		<th><?php __('Manager'); ?></th>
		<th><?php __('Type'); ?></th>
		<th><?php __('Divisions'); ?></th>
		<th><?php __('Rounds'); ?></th>
		<th><?php __('Teams'); ?></th>
		<th class="actions"><?php __('Actions');?></th>
	</tr>
	<?php
		$i = 0;
		foreach ($league['Championship'] as $championship):
			$class = null;
			if ($i++ % 2 == 0) {
				$class = ' class="altrow"';
			}
		?>
		<tr<?php echo $class;?>>
			<td><?php echo $championship['strName'];?></td>
			<td><?php echo $championship['coach_id'];?></td>
			<td><?php echo $championship['strType'];?></td>
			<td><?php echo $championship['iNbDivisions'];?></td>
			<td><?php echo $championship['iNbRounds'];?></td>
			<td><?php echo $championship['iNbTeams'];?></td>
			<td class="actions">
				<?php echo $html->link(__('View', true), array('controller' => 'championships', 'action' => 'view', $championship['id'])); ?>
				<?php echo $html->link(__('Edit', true), array('controller' => 'championships', 'action' => 'edit', $championship['id'])); ?>
				<?php echo $html->link(__('Delete', true), array('controller' => 'championships', 'action' => 'delete', $championship['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $championship['id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $html->link(__('New Championship', true), array('controller' => 'championships', 'action' => 'add','league_id' =>  $league['League']['id']));?> </li>
		</ul>
	</div>
</div>
<div class="related">
	<h3><?php __('Teams');?></h3>
	<?php if (!empty($league['Team'])):?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php __('Name'); ?></th>
		<th><?php __('Race'); ?></th>
		<th><?php __('Value'); ?></th>
		<th><?php __('Coach'); ?></th>
		<th class="actions"><?php __('Actions');?></th>
	</tr>
	<?php
		$i = 0;
		foreach ($league['Team'] as $team):
			$class = null;
			if ($i++ % 2 == 0) {
				$class = ' class="altrow"';
			}
	?>
			<td><?php echo $team['strName'];?></td>
			<td><?php echo $html->link($team['Race']['DATA_CONSTANT'], array('controller' => 'races', 'action' => 'view', $team['race_id']));?></td>
			<td><?php echo $team['iValue'];?></td>
			<td><?php echo $html->link($team['Coach']['strName'], array('controller' => 'coaches', 'action' => 'view', $team['coach_id']));?></td>
			<td class="actions">
				<?php echo $html->link(__('View', true), array('controller' => 'teams', 'action' => 'view', $team['id'])); ?>
				<?php echo $html->link(__('Edit', true), array('controller' => 'teams', 'action' => 'edit', $team['id'])); ?>
				<?php echo $html->link(__('Delete', true), array('controller' => 'teams', 'action' => 'delete', $team['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $team['id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>
</div>
